CC=gcc
SRC = $(wildcard *.c */*.c)
OBJS = $(patsubst %.c, %.o, $(SRC))
DEP_FILES := $(patsubst %, .%.d,$(OBJS))
CFLAGS = -g -Werror
LDFLAGS = -luv -lmysqlclient -lcurl
TARGET = targets

$(TARGET): $(OBJS)
	$(CC) -o $@ $^ $(LDFLAGS)

-include $(DEP_FILES)

%.o: %.c
	$(CC) -o $@ -c $(CFLAGS) $< -MD -MF .$@.d

clean:
	rm -rf $(TARGET) $(OBJS) $(DEP_FILES)

distclean:
	rm -rf $(DEP_FILES)

.PHONY: clean